import {DndDemo1Provider, useDndDemo1} from "@/pages/admin/test/tmp/DndDemo1.tsx";
import {Button} from "antd";

const Tmp = () => {

    return (
        <div className={"w-full h-full"}>
            <DndDemo1Provider>
                <>
                    <First/>
                    <Other/>
                </>
            </DndDemo1Provider>
        </div>
    );
};


const First = () => {
    const [text] = useDndDemo1();

    return <>
        <div className="text-2xl">First</div>
        <div className="text-xl">
            text: {text}
        </div>
    </>
}


const Other = () => {
    const [text, setText] = useDndDemo1();
    return (
        <div>
            <div className="text-2xl">
                Other
            </div>
            <div className="text-xl">
                text: {text}
                <Button onClick={()=> setText("Hello")}>Change</Button>
            </div>
        </div>
    )
}

export default Tmp;
